package rabbitmq;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

/**
 * @author hubert
 * @date 2018/3/29
 * @description
 */
public class ConnectionService {

	public Connection initConn() throws Exception{
		ConnectionFactory factory = new ConnectionFactory();
		factory.setHost("localhost");
		factory.setPort(5672);
		factory.setUsername("test");
		factory.setPassword("test");
		factory.setVirtualHost("test_vhosts");
		return factory.newConnection();
	}


}
